import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children:[
      {
        path: '/',
        name: 'index',
        component:()=>import("@/views/Index"),
      },
      {
        path: 'order',
        name: 'order',
        component:()=>import("@/views/Order"),
      },
      {
        path: 'my',
        name: 'my',
        component:()=>import("@/views/My"),
      },
    ],

  },
  {
    path: '/login',
    name: 'login',
    component:()=>import("@/views/Login"),
  },
  {
    path: '/address',
    name: 'address',
    component:()=>import("@/views/Address"),
  },
  {
    path: '/search',
    name: 'search',
    component:()=>import("@/views/Search"),
  },
  {
    path: '/shop/:shopId.html',
    name: 'shop',
    component:()=>import("@/views/ShopDetail"),
  },
  {
    path: '/shopList/:shopTypeId',
    name: 'shopList',
    component:()=>import("@/views/ShopList"),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  linkActiveClass:"is-selected"
})

export default router
